Component({
  data: {
    selected:0,
    color: "#DADADA",
    selectedColor: "#00B4C4",
    backgroundColor: "#ffffff",
    list: [
      {
        pagePath: "/pages/index/index",
        text: "医家养",
        iconPath: "../images/home.png",
        selectedIconPath: "../images/home-selected.png"
      },
      {
        pagePath: "/pages/zhuanbing/index",
        text: "专病管理",
        iconPath: "../images/zhuanbing.png",
        selectedIconPath: "../images/zhuanbing-selected.png"
      },
      {
        pagePath: "/pages/shop/shop",
        text: "慢病管理",
        iconPath: "../images/manbing.png",
        selectedIconPath: "../images/manbing-selected.png"
      },
      {
        pagePath: "/pages/personal/personal",
        text: "我",
        iconPath: "../images/user.png",
        selectedIconPath: "../images/user-selected.png"
      }
    ]
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.setStorageSync('categoryId', '')
      wx.switchTab({
        url: url,
      })
      this.setData({
        selected: data.index
      })
    }
  }
})